<template>
  <div class="app-container">
    <el-form ref="form" :model="data" label-width="160px">
      <el-form-item label="电表id：">
        <div>{{data.id}}</div>
      </el-form-item>
      <!--<el-form-item label="customerId">
        <div>{{data.customerId}}</div>
      </el-form-item>
      <el-form-item label="storageId">
        <div>{{data.storageId}}</div>
      </el-form-item>
      <el-form-item label="dtuId">
        <div>{{data.dtuId}}</div>
      </el-form-item>-->
      <el-form-item label="数字电表编号：">
        <div>{{data.meterCode}}</div>
      </el-form-item>
      <el-form-item label="数字电表名称：">
        <div>{{data.meterName}}</div>
      </el-form-item>
      <el-form-item label="型号：">
        <div>{{data.model}}</div>
      </el-form-item>
      <!--<el-form-item label="联系电话">
        <div>{{data.contactName}}</div>
      </el-form-item>-->
      <el-form-item label="类型：">
        <div>{{data.type}}</div>
      </el-form-item>
      <el-form-item label="状态：">
        <div>{{data.status|statusName()}}</div>
      </el-form-item>
      <el-form-item label="创建时间：">
        <div>{{data.createTime}}</div>
      </el-form-item>
      <el-form-item label="更新时间：">
        <div>{{data.updateTime}}</div>
      </el-form-item>

    </el-form>
  </div>
</template>

<script>
import {meterDetail} from "../../api/meter";

export default {
  name: "detail",
  data(){
    return{
      data:{}
    }
  },
  filters: {
    statusName(status) {
      if (status===1) {
        return '正常';
      }else{
        return '异常'
      }
    }
  },
  created() {
    this.getDetail(this.$route.query.id)
  },
  methods:{
    getDetail(id){
      meterDetail({id:id}).then(response => {
        this.data = response.data.data
      })
    }
  }
}
</script>

<style scoped>

</style>
